﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ValidateBankAccountUtil
{
    /// <summary>
    /// 返回参数
    /// </summary>
    public class ReturnBankAccountModel
    {
        /// <summary>
        /// 应答码
        /// </summary>
        public string ResponseCode;
        /// <summary>
        /// 应答消息
        /// </summary>
        public string Message;
        /// <summary>
        /// 应答报文
        /// </summary>
        public Dictionary<string, object> data;
    }
    /// <summary>
    /// 接口入参
    /// </summary>
    public class BankAccountParam
    {
        /// <summary>
        /// 商户id
        /// </summary>
        public string AppId;
        /// <summary>
        /// 商户密码	
        /// </summary>
        public string AppPwd;
        /// <summary>
        /// 上送报文
        /// </summary>
        public BankAccountItemParam data;
    }
    public class BankAccountItemParam
    {
        /// <summary>
        /// 查询类型
        /// </summary>
        public string TradeType;
        /// <summary>
        /// 卡号	
        /// </summary>
        public string CardNo;
        /// <summary>
        /// 姓名
        /// </summary>
        public string CustomerName;
        /// <summary>
        /// 手机号	
        /// </summary>
        public string PhoneNo;
        /// <summary>
        /// 证件号
        /// </summary>
        public string CertifId;
        /// <summary>
        ///证件类型
        /// </summary>
        public string CertifTp;
        /// <summary>
        /// 银行卡CVN2
        /// </summary>
        public string CVN2;
        /// <summary>
        /// 银行卡有效期
        /// </summary>
        public string Expired;
        /// <summary>
        ///	订单号	
        /// </summary>
        public string OrderId;
        /// <summary>
        ///交易场景编码	
        /// </summary>
        public string TransCode;
    }

    public class TradeTypeConst
    {
        /// <summary>
        ///两要素（卡号 + 姓名）
        /// </summary>
        public const string 卡号姓名 = "0201";

        /// <summary>
        /// 两要素（卡号 + 身份证号）
        /// </summary>
        public const string 卡号身份证号 = "0202";

        /// <summary>
        /// 三要素(卡号 + 姓名 + 身份证号)
        /// </summary>
        public const string 卡号姓名身份证号 = "0301";
        /// <summary>
        ///四要素（卡号 + 姓名 + 身份证号 + 手机号）
        /// </summary>

        public const string 卡号姓名身份证号手机号 = "0401";
        /// <summary>
        /// 六要素（卡号 + 姓名 + 身份证号码 + 手机号 + CVN2 + expired）
        /// </summary>
        public const string 卡号姓名身份证号码手机号CVN2expired = "0601";

        private static readonly Dictionary<string, string> Names = new Dictionary<string, string>
        {
            {"0201","卡号姓名"},
        };

        /// <summary>
        /// 号段类型键值
        /// </summary>
        /// <returns></returns>
        public static string[] GetAllKeys()
        {
            return Names.Keys.ToArray();
        }

        /// <summary>
        /// 获取号段类型名称
        /// </summary>
        /// <returns></returns>
        public static string GetName(string key)
        {
            if (Names.ContainsKey(key))
                return Names[key];
            else
                return string.Empty;
        }

        /// <summary>
        /// 获取键值列表
        /// </summary>
        /// <returns></returns>
        public static List<KeyValuePair<string, string>> GetList()
        {
            return Names.ToList();
        }
    }
}
